package com.edu.schoolforum.service;

import cn.hutool.db.PageResult;
import com.edu.schoolforum.dto.*;
import com.edu.schoolforum.mapper.UserMapper;
import com.edu.schoolforum.pojo.Post;
import com.edu.schoolforum.pojo.User;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author tao
 * @date 2021/8/8 13:47
 */
@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private UserMapper userMapper;
    @Override
    public User login(User user) {
        return userMapper.login(user);
    }

    @Override
    public List<User> getList() {
        return userMapper.getList();
    }

    @Override
    public int insertUser(User user) {
        return userMapper.insertUser(user);
    }

    @Override
    public User getUserByName(String name) {
        return userMapper.getUserByName(name);
    }

    @Override
    public int updateUserPassword(User user) {
        return userMapper.updateUserPassword(user);
    }

    @Override
    public int updateUserAuthority(UpdateUserAuthorityDto updateUserAuthorityDto) {
        return userMapper.updateUserAuthority(updateUserAuthorityDto);
    }

    @Override
    public int updateUserStatus(UpdateUserStatusDto updateUserStatusDto) {
        return userMapper.updateUserStatus(updateUserStatusDto);
    }

    @Override
    public int getUserStatus(User user) {
        return userMapper.getUserStatus(user);
    }

    @Override
    public List<User> getAllUser() {
        return userMapper.getAllUser();
    }

    @Override
    public int updateUserAvatarUrl(UpdateUserAvatarUrlDto updateUserAvatarUrlDto) {
        return userMapper.updateUserAvatarUrl(updateUserAvatarUrlDto);
    }

    @Override
    public int updateUserTelephone(UpdateUserTelephone updateUserTelephone) {
        return userMapper.updateUserTelephone(updateUserTelephone);
    }


}
